import React, { Component } from 'react'

import BetterScroll from 'better-scroll'
export default class App extends Component {
    state={
        list:["111","222","333","444","555","666","777","888","999","000"]
    }
     // 成功render并渲染完成真实的DOM之后触发，可以修改DOM
    componentDidMount(){
        new BetterScroll(".wepper")
    }
    //render只能访问this.props和this.state,不允许修改状态和DOM输出
  render() {
    return (
      <div className='wepper' style={{height:"150px",width:"100px",overflow:"hidden",background:"pink"}}>
        <ul>
            {this.state.list.map((item,index)=>
            <li key={index}>{item}</li>
            )}
        </ul>
      </div>
    )
  }
}
